#include <iostream>
#include <string>

using namespace std;

class Solution1 {
public:
    int countDigits(int num) {
        string str = to_string(num);

        int count = 0;
        for (int i = 0; i < str.size(); i++)
        {
            int n = str[i] - '0';
            if ((num % n) == 0)
            {
                count++;
            }
        }
        return count;
    }
};

//////////////////////////////////////////////////////
#include <vector>

class Solution {
public:
    int lengthOfLIS(vector<int>& nums) {
        int n = nums.size();
        vector<int> dp(n, 1);

        int max_len = 1;
        for (int i = 1; i < n; i++)
        {
            for (int j = i - 1; j >= 0; j--)
            {
                if (nums[i] > nums[j])
                {
                    dp[i] = max(dp[i], dp[j] + 1);
                    max_len = max(max_len, dp[i]);
                }
            }
        }

        return max_len;
    }
};